// API 响应状态码
export const API_CODES = {
  SUCCESS: 200,
  UNAUTHORIZED: 401,
  FORBIDDEN: 403,
  NOT_FOUND: 404,
  SERVER_ERROR: 500,
} as const;

// 用户等级常量
export const USER_CLASS = {
  UNVERIFIED: 0,
  USER: 1,
  VIP: 2,
  SENIOR: 3,
  MODERATOR: 4,
  ADMIN: 5,
  SUPER_ADMIN: 9,
} as const;

// 用户状态常量
export const USER_STATUS = {
  DISABLED: 0,
  ACTIVE: 1,
  BANNED: 2,
} as const;

// 种子状态常量
export const TORRENT_STATUS = {
  PENDING: 0,
  APPROVED: 1,
  REJECTED: 2,
} as const;

// 促销类型常量
export const PROMOTION_TYPE = {
  NONE: 0,
  FREE: 1,
  DOUBLE_UPLOAD: 2,
  DOUBLE_DOWNLOAD: 3,
  HALF_DOWNLOAD: 4,
} as const;

// 分页默认配置
export const PAGINATION_CONFIG = {
  DEFAULT_PAGE: 1,
  DEFAULT_PAGE_SIZE: 20,
  PAGE_SIZE_OPTIONS: ['10', '20', '50', '100'],
} as const;

// 时间常量
export const TIME_CONSTANTS = {
  SECOND: 1000,
  MINUTE: 60 * 1000,
  HOUR: 60 * 60 * 1000,
  DAY: 24 * 60 * 60 * 1000,
  WEEK: 7 * 24 * 60 * 60 * 1000,
} as const;

// 文件大小常量
export const FILE_SIZE = {
  KB: 1024,
  MB: 1024 * 1024,
  GB: 1024 * 1024 * 1024,
  TB: 1024 * 1024 * 1024 * 1024,
} as const;

// 种子分类
export const TORRENT_CATEGORIES = [
  { value: '', label: '全部分类' },
  { value: '电影', label: '电影' },
  { value: '电视剧', label: '电视剧' },
  { value: '音乐', label: '音乐' },
  { value: '软件', label: '软件' },
  { value: '游戏', label: '游戏' },
  { value: '电子书', label: '电子书' },
  { value: '动漫', label: '动漫' },
  { value: '其他', label: '其他' },
] as const;

// 错误消息
export const ERROR_MESSAGES = {
  NETWORK_ERROR: '网络连接失败，请检查网络后重试',
  UNAUTHORIZED: '登录已过期，请重新登录',
  FORBIDDEN: '没有权限执行此操作',
  NOT_FOUND: '请求的资源不存在',
  SERVER_ERROR: '服务器内部错误，请稍后重试',
  UNKNOWN_ERROR: '未知错误，请稍后重试',
} as const;

// 成功消息
export const SUCCESS_MESSAGES = {
  LOGIN_SUCCESS: '登录成功',
  LOGOUT_SUCCESS: '已退出登录',
  REGISTER_SUCCESS: '注册成功',
  UPDATE_SUCCESS: '更新成功',
  DELETE_SUCCESS: '删除成功',
  UPLOAD_SUCCESS: '上传成功',
  DOWNLOAD_SUCCESS: '下载成功',
} as const;

// 本地存储键名
export const STORAGE_KEYS = {
  TOKEN: 'token',
  USER_PREFERENCES: 'userPreferences',
  THEME: 'theme',
} as const;

// 路由路径
export const ROUTES = {
  HOME: '/',
  LOGIN: '/login',
  REGISTER: '/register',
  TORRENTS: '/torrents',
  UPLOAD: '/upload',
  FORUM: '/forum',
  MESSAGES: '/messages',
  ADMIN: '/admin',
  PROFILE: '/profile',
  SETTINGS: '/settings',
} as const;
